<template>
    <el-card class="info-portraits">
        <content-item 
        class="info-item" 
        :data="data" 
        :title="`${companyName}`" 
        :rowguid="data.guid" 
        >
            <template slot="footer-left">
                <div 
                v-show="data.city"
                class="city"
                >
                    企业所在地：{{data.city}}
                </div>
            </template>

            <template slot="tag">
                <div
                v-show="data.regstatus"
                class="regstatus"
                >
                    {{data.regstatus}}
                </div>
            </template>

            <template slot="icon">
                <div></div>
            </template>

            <template slot="tag-after"></template>

            <template slot="time">
                <div></div>
            </template>

            <template slot="footer">
                <div class="item-tools">
                    <div 
                    class="btn-share"
                    v-czc="['查企业-详情-招标分析（企业画像）', '点击按钮' , '分享', 0 ,`checkEnterpriseBid-btn-share`]"
                    @click="sharePageHandler"
                    >
                        <i class="iconfont">&#xe86e;</i>
                        分享
                    </div>

                    <div 
                    class="btn-follow"
                    v-czc="['查企业-详情-招标分析（企业画像）', '点击按钮' , '关注/取消关注', 0 ,`checkEnterpriseBid-btn-followOrCancel`]"
                    >
                        <collect-star
                        :data="{ objectguid: data.guid, objectname: data.searchname, objecttype: 'enterprise', marktype: 'follow',}"
                        :defaultVal="data.bj === '1'"
                        :icon="['&#xeca2;', '&#xeca1;']"
                        >
                            <div class="text">
                                关注项目
                            </div>
                        </collect-star>
                    </div>
                </div>
            </template>
        </content-item>
    </el-card>
</template>

<script>
import CONFIG_PROJECT from '@config/project';

import notice from '@/mixins/notice.js';

import CollectStar from '@components/sys/collect.vue';
import ContentItem from '@/pages/application/info/components/item.vue';

export default {
    mixins: [notice],
    components: {
        CollectStar,
        ContentItem,
    },
    props: {
        data: {
            type: Object,
            default: () => ({}),
        },
    },
    data() {
        return {

        };
    },
    computed: {
        companyName: function () {
            return this.getQuery('company');
        },
    },
    methods: {
        // 分享
        sharePageHandler() {
            var {pathname, search} = window.location,
                url = `${CONFIG_PROJECT.origins.www}${pathname}${search}`;

            this.$copyText(url).then((e) => {
                showMsgBox('已复制到剪贴板，请前往粘贴', 'success');
            });
        },
    },
};
</script>

<style lang="scss" scoped>
@import '@css/var.scss';

    .info-portraits {
        margin-top: 8px;

        .info-item {
            ::v-deep .title {
                width: 100%;
            }

            .city{
                
            }

            .regstatus{
                display: inline-block;
                height: 21px;
                line-height: 21px;
                padding: 0 10px;
                margin-left: .5em;
                font-size: 12px;
                border:none; 
                border-radius: 0px;
                color: #909399;
                background-color:#edeef4;
            }

            .item-tools {
                display: flex;
                justify-content: flex-end;

                & > div {
                    margin-left: 14px;
                    align-items: baseline;
                    color: $infoColor;
                }

                .btn-share{
                    cursor: pointer;

                    &:hover{
                        color: $primaryColor;
                    }

                    i{
                        &.active{
                            color: $primaryColor;
                        }
                    }
                }
            }
        }
    }
</style>